package com.example.easyexcel.model;

import com.alibaba.excel.annotation.ExcelProperty;
import com.example.easyexcel.annotation.ExcelDropdown;
import com.example.easyexcel.converter.AddressListConverter;
import com.example.easyexcel.converter.UserStatusEnumConverter;
import com.example.easyexcel.enums.UserStatusEnum;
import com.example.easyexcel.service.impl.ExcelDynamicDropdownDataServiceImpl;
import lombok.Data;

import java.util.List;

/**
 * @author dangwen1
 * @date 2021年12月02日 20:22
 * @description
 */
@Data
public class UserModel {

    @ExcelProperty(value = "用户姓名", index = 0)
    private String username;
    @ExcelProperty(value = "用户年龄", index = 1)
    @ExcelDropdown(sourceClass = ExcelDynamicDropdownDataServiceImpl.class)
    private int age;
    @ExcelProperty(value = "用户状态", converter = UserStatusEnumConverter.class, index = 2)
    private UserStatusEnum userStatusEnum;
    @ExcelProperty(value = "用户地址", converter = AddressListConverter.class, index = 3)
    private List<Address> addresses;
}
